package com.example.test.service.impl;

import com.example.test.dao.IUserDao;
import com.example.test.entity.User;
import com.example.test.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService implements IUserService {
    @Autowired
    private IUserDao iUserDao;

    @Override
    public User login(String username, String password) {
        return iUserDao.login(username, password);
    }

    @Override
    public User getUser(String username) {
        return iUserDao.getUser(username);
    }

    @Override
    public List<User> list() {
        return iUserDao.list();
    }

    @Override
    public void add(String username, String password, int screen) {
        iUserDao.add(username,password,screen);
    }

    @Override
    public void del(int id) {
        iUserDao.del(id);
    }

    @Override
    public void update_pass(int id, String password) {
        iUserDao.update_pass(id,password);
    }

    @Override
    public void update_screen(int id, int screen) {
        iUserDao.update_screen(id,screen);
    }
}
